<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>新增用户</title>
	<link rel="stylesheet" href="__ACSS__/table.css">
	<script src="__AJS__/jquery-3.3.1.min.js"></script>
	<!-- 配置文件 -->
    <script type="text/javascript" src="__COMMON__/ueditor/ueditor.config.js"></script>
    <!-- 编辑器源码文件 -->
    <script type="text/javascript" src="__COMMON__/ueditor/ueditor.all.js"></script>
    <!-- 中文编码 -->
    <script type="text/javascript" src="__COMMON__/ueditor/lang/zh-cn/zh-cn.js"></script>
    <!-- 实例化编辑器 -->
    <script type="text/javascript">
        var ue = UE.getEditor('container');
    </script>
</head>
<body>
	<div class="table-wrap">
		<div class="table-main">
			<div class="ibox-title">
				<h3>新增栏目<small>&nbsp;&nbsp;下方填写数据均不能为空</small></h3>
			</div>
			
			<div class="ibox-content">	
				<form action="{:url('admin/admin_article/save')}" class="form-main" method="post" enctype="multipart/form-data">

					<div class="form-group">
						<ul>
							<li>
								<span class="form-title">选择栏目</span>
								<select name="catId" class="form-lower form-text">
									{volist name="res" id="v"}
									<option value="{$v.catId}">{$v.catName}</option>
									{/volist}
    								
								</select>
								<em class="form-error">* 不能为空</em>
							</li>
							<li>
								<span class="form-title">标题</span>
								<input class="form-text" type="text" placeholder="请输入标题"  name="articleTitle">
								<em class="form-error">* 不能为空</em>
							</li>
							<li>
								<span class="form-title">上传缩略图</span>
								<div class="form-img" title="点击修改图片">
                                    <input type="file" id="fileuploadgame" class="fileupload-input" name="thumbnail">
                                    <div class="form-img-box">
                                        <div class="form-pre-item">
                                        	<img src="">
                                        </div>
                                        <em class="edit_img_icon">&nbsp;</em>
                                    </div>
                                </div>
							</li>
							<li>
								<span class="form-title">关键字</span>
								<input class="form-text" type="text" placeholder="请输入关键字"  name="articleKey">
							</li>
							<li>
								<span class="form-title">摘要</span>
								<textarea class="form-text form-h100" name="description"></textarea>
								<em class="form-error">* 不能为空</em>
							</li>
                            <li>
                                <span class="form-title">状态</span>
                                <label class="form-radio"><input type="radio" value="1" name="isShow" checked>开启</label>
                                <label class="form-radio"><input type="radio" value="0" name="isShow" >关闭</label>
                            </li>
							<li>
								<span class="form-title">文章内容</span>
								<textarea name="articleContent" id="container" class="form-textarea"></textarea>
							</li>
							<li>
								<span class="form-title"></span>
								<input class="form-submit-btn" type="submit" value="提交">
								<a href="{:url('admin/admin_article/index')}" class="form-back-btn"  name="">返回</a>
							</li>
						</ul>
					</div>

				</form>
			</div>
		</div>
	</div>
	<script>
        $(document).ready(function(){
            // 本地化预览图片
            $('.form-pre-item').hide();
            // 单个
            $('#fileuploadgame').change(function(){
                var objUrl = getObjectURL(this.files[0]) ;
                if ( objUrl ) {
                    $(this).next('div').find('.form-pre-item').children('img').attr('src',objUrl);
                    $('.form-pre-item').show();
                }
            });
            
        });
        // 本地化预览图片 //建立一個可存取到該file的url
        function getObjectURL(file) {
            var url = null ;
            if (window.createObjectURL!=undefined) { // basic
                url = window.createObjectURL(file) ;
            }else if (window.URL!=undefined) {
            // mozilla(firefox)
                url = window.URL.createObjectURL(file) ;
            } else if (window.webkitURL!=undefined) {
            // webkit or chrome
                url = window.webkitURL.createObjectURL(file) ;
            }
            return url ;
        }
    </script>
</body>
</html>